package com.hzit.manager.entity;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class MyBeanPostProcessor implements BeanPostProcessor {
	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof Student) {
			System.out.println("4. MyBeanPostProcessor#postProcessBeforeInitialization()");
		}
		return bean;
	}
	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof Student) {
			System.out.println("8. MyBeanPostProcessor#postProcessAfterInitialization()");
		}
		return bean;
	}

}